package com.qire.manhua.activity;

import android.os.Bundle;

import com.qire.antscore.annotation.RouteMapping;
import com.qire.antsrouter.inject.Autowired;
import com.qire.common.constant.Navigation;
import com.qire.common.inject.EventControllerInjector;
import com.qire.common.inject.ViewModelInjector;
import com.qire.common.support.base.BaseActivity;
import com.qire.common.utils.ThemeUtil;
import com.qire.manhua.R;
import com.qire.manhua.controller.ComicDirectorySelectorController;
import com.qire.manhua.databinding.ActivityComicDirectorySelectorBinding;
import com.qire.manhua.model.entity.ComicBookEntity;
import com.qire.manhua.model.viewModel.impl.ComicDirectorySelectorViewModel;

import androidx.annotation.Nullable;

/**
 * 漫画目录选择器页
 */
@RouteMapping(path = Navigation.Page.ComicDirectorySelectorPage)
public class ComicDirectorySelectorActivity extends BaseActivity<ActivityComicDirectorySelectorBinding> {

    @Autowired
    ComicBookEntity comicBookEntity;

    @Autowired(injector = ViewModelInjector.class)
    ComicDirectorySelectorViewModel viewModel;

    @Autowired(injector = EventControllerInjector.class)
    ComicDirectorySelectorController controller;


    @Override
    public int layoutRid() {
        return R.layout.activity_comic_directory_selector;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ThemeUtil.changeStatusBarLightOrDark(this, true, true);

        viewModel.onAddition(controller);
        controller.onAddition(viewModel);

        viewModel.loadComicBookEntity(comicBookEntity);
    }
}
